import request from '@/utils/request'

export const listMeals = (search) =>
    request({
        url: '/healthPlan',
        method: 'get',
        params: {
            name: search.name,
            offset: search.offset,
            limit: search.limit
        }
    })

export const getMealsById = (id) =>
    request({
        url: '/healthPlan/' + id,
        method: 'get'
    })

export const updateMeals = (meals) =>
    request({
        url: '/healthPlan',
        method: 'put',
        data: meals
    })

export const saveMeals = (meals) =>
    request({
        url: '/healthPlan',
        method: 'post',
        data: meals
    })

export const listMealsType = () =>
    request({
        url: '/healthPlanType',
        method: 'get'
    })